package com.jxb;

// import com.jxb.service.MybatisTest;
import com.jxb.proxy.ProxyConfig;
import com.jxb.proxy.introduction.User;
import com.jxb.proxy.introduction.Verifier;
import com.jxb.service.MybatisTest;
import com.jxb.service.UserInterface;
import com.jxb.service.UserService;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 类注释
 *
 * @author jiaobo
 * @date Created in 2024/11/16 12:06
 **/
public class Test {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(ProxyConfig.class);
        context.refresh();

        User user1 = new User();
        user1.setUsername("abc");
        user1.setPassword("def");

        UserService userService = (UserService) context.getBean("userServiceProxy");
        Verifier v = (Verifier) userService;
        if(v.validate(user1)) {
            System.out.println("验证成功");
            userService.test();
        }

//        context.close();
    }

}
